/*
 * @Description:
 * @Author: 张效玮2 yythis@163.com
 * @Date: 2025-08-15 15:54:24
 * @LastEditors: 张效玮2
 * @LastEditTime: 2025-08-15 16:33:51
 */
/**
 * 认证相关接口
 * @author 张效玮2 yythis@163.com
 * @date 2025-01-15
 */

import type * as Auth from "./type"
import { request } from "@/http/axios"

/** 发送短信验证码 */
export function sendSmsApi(data: Auth.SendSmsRequestData) {
  return request<Auth.SendSmsResponseData>({
    url: "/user/send-sms",
    method: "post",
    data
  })
}

/** 手机号登录 */
export function phoneLoginApi(data: Auth.PhoneLoginRequestData) {
  return request<Auth.PhoneLoginResponseData>({
    url: "/user/phone-login",
    method: "post",
    data
  })
}

/** 刷新访问令牌 */
export function refreshTokenApi(data: Auth.RefreshTokenRequestData) {
  return request<Auth.RefreshTokenResponseData>({
    url: "/user/refresh-token",
    method: "post",
    data
  })
}

/** 退出登录 */
export function logoutApi() {
  return request<Auth.LogoutResponseData>({
    url: "/user/logout",
    method: "post"
  })
}
